import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { AppVersion } from '@ionic-native/app-version';

/**
 * Generated class for the VersionPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-version',
  templateUrl: 'version.html',
})
export class VersionPage {

  appName: string;
  packageName: string;
  versionCode: string | number;
  versionNumber: string;

  constructor(public navCtrl: NavController, private appVersion: AppVersion, public navParams: NavParams) {
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad VersionPage');
    this.appVersion.getAppName().then(n=>{this.appName = n});
    this.appVersion.getPackageName().then(p=>{this.packageName = p});
    this.appVersion.getVersionCode().then(vc=>{this.versionCode = vc});
    this.appVersion.getVersionNumber().then(vn=>{this.versionNumber = vn});

  } 

}
